In Ramesh et al, (2006). “JPEG Compression History Estimation for Color Images”, IEEE Transactions on Image Processing, vol. 15,no. 6,it is recognized that an image's compression history (“CH”) is often not directly available from its current representation. The example where JPEG images are often imported into Microsoft Powerpoint or Word documents using graphics programs such as Microsoft Clip Gallery and then stored internally using a decompressed format is given. Another example that is given is the conversion of JPEG images to lossless compression formats such as Windows bitmap (BMP) format (say, to create a background image for Windows or to feed a print driver) or Tagged Image File Format (TIFF). In such cases, the JPEG compression settings are discarded after decompression. The authors provide a suggestion for a method of estimating the JPEG CH from a given JPEG-decompressed color image, and refer to the underlying problem as JPEG Compression History Estimation (CHEst).
U.S. Pat. No. 6,233,359 to Ratnaker et al. discloses a technique that reduces the size of an existing PEG file or set of discrete cosine transform (DCT) coefficients to satisfy a certain bit budget by setting to zero coefficients whose magnitude is below a certain threshold and which occur after a certain ordinal number in the zig-zag scan. The cutoff ordinal number is chosen using a clever savings calculation strategy. This strategy is implemented by filling appropriate savings values in an array of savings values, Savings[1], . . . , Savings[63]. The value Savings[n] is exactly the number of bits saved by reducing the thresholding cutoff ordinal number from n+1 to n. When a non-zero coefficient is set to zero, bits are saved because two runs of zeros (the one preceding it and the one following it) get combined into a single, longer run of zeros. The exact number of bits saved can be calculated by adding the bits needed to code the previous and next runs, and subtracting the bits needed to code the combined run. Some special conditions (runs longer than 16 and end-of-block conditions) need to be carefully factored into the computation.